package com.hxzy.projectssmplus.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hxzy.projectssmplus.dto.SysRoleDTO;
import com.hxzy.projectssmplus.entity.SysAdminUser;
import com.hxzy.projectssmplus.entity.SysRole;
import com.hxzy.projectssmplus.service.SysRoleService;
import com.hxzy.projectssmplus.vo.AjaxTableInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class RoleController extends BaseController {


    @Autowired
    private SysRoleService sysRoleService;

     @PreAuthorize("hasAuthority('system:role:list')")
     @GetMapping(value = "/role/data")
    public AjaxTableInfo  ajaxData(SysRoleDTO sysRoleDTO){
         IPage<SysRole> page = this.sysRoleService.searchByXML(super.startPage(), sysRoleDTO);
         return super.getTableInfo(page);
     }
}
